"""
获取登录成功的令牌，拼接到请求头，并返回
"""
import requests
from common.get_day import getDate

def get_header():
    day = getDate()
    url="https://ihrm-java.itheima.net/api/sys/login"
    data={"mobile":"13800000002","password":"929itheima.CN032@."+day}
    resp=requests.post(url=url,json=data)
    token=resp.json().get("data")
    header = {"Content-Type": "application/json",
              "Authorization": "Bearer "+token}
    return header

if __name__ == '__main__':
    get_header()
